package rabid;

import java.util.Iterator;
import java.util.List;


/**
 * This class represents a query passed in by the user. 
 * 
 * @author Andrew Bernard
 */
public class Query {
  List wordsInQuery;
  
  /**
   */
  public Query(List wordsInQuery) {   
    this.wordsInQuery = wordsInQuery;
  }
  
  public boolean evaluate(IndexedFile file) {
    boolean evaluatedQuery = true;
    Iterator itr = wordsInQuery.iterator();
    while(itr.hasNext()) {
      Object word = itr.next();
      if(!file.isTermInFile(word.toString())) {
        evaluatedQuery = false;
        break;
      }
    }
    return evaluatedQuery;
  }
  
  
}
